<nav class="nav navbar-default">
    <div class="container-fluid">
        <div class="col-md-offset-1 col-md-10">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li id="home-page"><a href="/">首页</a></li>
                    {% for item in nav_item_list %}
                        <li id="nav-{{ item.id }}"><a href="{{ item.url }}">{{ item.title }}</a></li>
                    {% endfor %}
                    {% if user.is_authenticated %}
                        <li><a href="/dashboard/">后台</a></li>
                        <li><a href="{% url 'user-logout' %}">注销</a></li>
                    {% else %}
                        <li id="login"><a href="{% url 'user-login' %}">登录</a></li>
                        <li id="sign-up"><a href="{% url 'user-apply' %}">注册</a></li>
                    {% endif %}
                  </ul>
            </div>
        </div>
    </div>
</nav>